from django.urls import path
from ecom.views.ecom.product import views

app_name = 'product'

urlpatterns = [
    path('manage/', views.product_manage_view, name='product_manage'),   # 商品管理
    path('categories/', views.create_or_update_category, name='create_or_update_category'),  # 创建或修改分类
    path('categories/<int:categoryId>/', views.delete_category, name='delete-category'),     # 删除分类
    path('products/', views.get_products_by_category, name='product-by-category'),   # 点击分类名获取商品
    path('categories/add_subcategory/', views.add_subcategory, name='add_subcategory'),  # 添加子分类

    path('create_product/', views.create_product, name='create_product'),
    path('product_category/', views.product_category, name='create_product'),  # 商品所属分类
    path('<int:pk>/', views.update_product, name='update_product'),

    path('product/create/', views.product_edit_view, name='product_create'),       # 属性说明1
    path('product/edit/<int:pk>/', views.product_edit_view, name='product_edit'),   # 属性说明2
    path('product/attributes/', views.attribute_history_api, name='attribute_api'),     # 属性说明3

]
